package com.hskn.hss.module.worklog.to;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.Objects;

@Data
@ApiModel(value = "园林古树养护接口-TO", description = "园林古树养护接口-TO")
public class AncientGardenTreesTO {
    @ApiModelProperty(value = "园林、古树类型", name = "treeType", example = "园林、古树类型")
    private String treeType;
    @ApiModelProperty(value = "日志类型", name = "LogType", example = "日志类型", hidden = true)
    private Integer LogType;
    @ApiModelProperty(value = "主体名称", name = "subjectName", example = "主体名称")
    private String subjectName;
    @ApiModelProperty(value = "提交人", name = "userId", example = "提交人")
    private String userId;
    @ApiModelProperty(value = "ids", name = "ids", allowableValues = "05fc631946a1414e895c460be6f5be91")
    private List<String> ids;
    @ApiModelProperty(value = "开始时间", name = "startTime", example = "2021-09-22 18:20:24")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;
    @ApiModelProperty(value = "结束时间", name = "endTime", example = "2021-09-22 18:20:24")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;
    @ApiModelProperty(value = "页数", name = "page", example = "1")
    private Integer page;
    @ApiModelProperty(value = "页面大小", name = "size", example = "10")
    private Integer size;

    public Integer getPage() {
        if (Objects.nonNull(page)) {
            return page;
        } else {
            return 1;
        }
    }


    public Integer getSize() {
        if (Objects.nonNull(size)) {
            return size;
        } else {
            return 20;
        }
    }

}

